home *** CD-ROM | disk | FTP | other *** search
- Path: dawn.mmm.com!news
- From: kjhopps@mmm.com (Kevin J Hopps)
- Newsgroups: comp.lang.c++
- Subject: Re: How to generate all the combinations of n numbers?
- Date: 27 Feb 1996 16:34:37 GMT
- Organization: 3M - St. Paul, MN 55144-1000 US
- Message-ID: <4gvbqt$rr4@dawn.mmm.com>
- References: <4giuc9$pq@news.cis.okstate.edu>
- Reply-To: kjhopps@mmm.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Madhav Kakani (kakani@osuunx.ucc.okstate.edu) wrote:
- > Hello everybody,
- > I am having problems in writing a c/c++ program which
- > generates all possible combinations of n given numbers.
- > For example, if an array x has some numbers
- >
- > int x[] = {1,2,3};
-
- > the program should generate the following output:
- > 1
- > 2
- > 3
- > 12
- > 13
- > 23
- > 123
-
- I think it would be wrong for us to do your homework for you.
- --
- Kevin J. Hopps e-mail: kjhopps@mmm.com
- 3M Company phone: (612) 737-4643
- 3M Center, Bldg. 235-2D-57 fax: (612) 737-2700
- St. Paul, MN 55144-1000 Opinions are my own. I don't speak for 3M.
- But 3M speaks for me -- I did not write the following line:
-
- Opinions expressed herein are my own and may not represent those of 3M.
-